import Util from './Util.js'
import TokenUtil from "../common/TokenUtil";

const FormUtil = {
    /*
     * 获取图片路径.
     * @memberof FormUtil
     * @param {Object} vm -  vue实例
     * @param {String} fileId -  文件ID
     * @param {Boolean} scale - 是否缩放
     * @returns {String}
     */
    getImagePath(vm, fileId, scale) {
        let accessToken = TokenUtil.getToken();
        let time=new Date().getTime();
        fileId=Util.encryptWord(fileId);
        let isScale=Util.encryptWord(scale);
        let url = vm.realUrl()+`/api-system/system/core/sysFile/previewImg?fileId=${fileId}&accessToken=${accessToken}&time=${time}&isScale=${isScale}` ;
        return url;
    },

}

export default FormUtil ;
